/**
 * @author Justin Akin
 * @version Action Pals Core Library 0.1.0
 */
package com.actionpals.graphics
{
	/**
	 * 
	 */	
	public class RectangleShape extends AbstractRoundedShape
	{
		
	//--------------------------------------------------------------------------------
	//
	//	Constructor
	//
	//--------------------------------------------------------------------------------
		
		/**
		 * Constructor
		 */
		public function RectangleShape( width:Number, height:Number, cornerRadius:uint = 0, fillColor:uint = 0, strokeThickness:uint = 0, strokeColor:uint = 0 )
		{			
			super( width, height, cornerRadius, fillColor, strokeThickness, strokeColor );
		}
		
	//--------------------------------------------------------------------------------
	//
	//	Protected Methods
	//
	//--------------------------------------------------------------------------------
		
		/**
		 * 
		 */
		protected override function draw():void
		{	
			graphics.clear();
			
			if( this.strokeGradient )
			{
				applyGradient( this.strokeGradient );
			}
			else
			{
				graphics.beginFill( this.strokeColor, this.strokeAlpha );
			}
			
			graphics.drawRoundRect( 0, 0, this.width, this.height, this.cornerRadius );
			graphics.drawRoundRect( this.strokeThickness, this.strokeThickness, this.fillWidth, this.fillHeight, this.innerRadius );
			
			if( this.fillGradient )
			{
				applyGradient( this.fillGradient );
			}
			else
			{
				graphics.beginFill( this.fillColor, this.fillAlpha );
			}
			
			graphics.drawRoundRect( this.strokeThickness, this.strokeThickness, this.fillWidth, this.fillHeight, this.innerRadius );
			graphics.endFill();
		}
	}
}